﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ThumbnailImages : System.Web.UI.UserControl
{
    protected int _ThumbNailWidth = 113;
    public int ThumbNailWidth
    {
        get { return _ThumbNailWidth; }
        set { _ThumbNailWidth = value; }
    }

    protected int _ThumbNailHeight = 81;
    public int ThumbNailHeight
    {
        get { return _ThumbNailHeight; }
        set { _ThumbNailHeight = value; }
    }

    public ImageAlign ThumbNailAlign
    {
        get { return imgThumbnail.ImageAlign; }
        set { imgThumbnail.ImageAlign = value; }
    }

    public string CssClass
    {
        get { return imgThumbnail.CssClass; }
        set { imgThumbnail.CssClass = value; }
    }

    public string ImageUrl
    {
        get { return imgThumbnail.ImageUrl; }
        set
        {
            imgThumbnail.Width = ThumbNailWidth;
            imgThumbnail.Height = ThumbNailHeight;
            imgThumbnail.ImageUrl = "~/Thumbnailer.ashx?type=thumb&file=" + value;
            //if (!string.IsNullOrEmpty(imgThumbnail.ImageUrl))
            //{
            //    imgThumbnail.ImageUrl = CreateThumbImage();
            //    imgThumbnail.Width = ThumbNailWidth;
            //    imgThumbnail.Height = ThumbNailHeight;
            //    imgThumbnail.Visible = !string.IsNullOrEmpty(imgThumbnail.ImageUrl) && imgThumbnail.Visible;
            //}
            //else
            //{
            //    imgThumbnail.Visible = false;
            //}
        }
    }

    public string AlternateText
    {
        get { return imgThumbnail.AlternateText; }
        set { imgThumbnail.AlternateText = value; }
    }

    protected string _ThumbPrefix = "thumb_";
    public string ThumbPrefix
    {
        get { return _ThumbPrefix; }
        set { _ThumbPrefix = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}